package com.example.lyonlinemusic.mapper;


import com.example.lyonlinemusic.model.Music;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Mapper
public interface LoveMusicMapper {

    //查询是否已经收藏过该音乐
    public Music findLoveMusicByMusicIdAndUserId(int userId,int musicId);

    //收藏音乐
    public boolean insertLoveMusic(int userId,int musicId);

    //取消收藏
    public int deleteLoveMusicByMusicIdAndUserId(int userId,int musicId);

    //查询当前用户收藏过的所有音乐
    public List<Music> findLoveMusicByUserId(int userId);

    //查询当前用户，指定为musicName的音乐，支持模糊查询
    public List<Music> findLoveMusicByMusicNameAndUserID(String musicName,int userId);

}
